<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript" src="js/vue.js"></script>
</head>
<body>

    <div id="root">

        <h1>11111</h1>
        <h1>{{text}}</h1>

        <button v-for="b in btns">{{b}}</button>

        <hr />
        <button @click="btn1">点我增加一行</button>
        <button @click="btn2">点我增加一个按钮</button>

    </div>
    
</body>

<script>

    vm = new Vue({
        el: '#root',
        data:{
            btns:[],
            text:""
        },
        methods:{
            btn2(){
                this.btns.push('haha,我是新增的按钮');
            },
            btn1(){
                this.text = 'haha,我是新增的一行'
            }
        }
    })
</script>


</html>